<template>
  <div :id="containerId" class="qiankun-child con" :style="isQK?' width: 100%;height: 100%;':''">
    <div class="_con">
      <!-- <ts-empty v-if="!loading&&showEmpty" description="-暂无权限访问-" /> -->
      <ts-loading :loading="loading"></ts-loading>
      <router-view ref="routerView" />
    </div>
    <!-- <div v-else>
      <router-view ref="routerView" />
    </div>-->
  </div>
</template>
<script>
import ThemeConfig from '@/utils/ThemeConfig'
import VERSION_INFO from '../public/config/versionCode.json'
import { consoleVersionInfo } from 'ts-element/packages/utils/utils'
export default {
  components: {},
  mixins: [ThemeConfig],
  data() {
    return {
      isQK: window.__POWERED_BY_QIANKUN__ || false, // 是否是乾坤
      showEmpty: false,
      loading: false,
      containerId: process.env.VUE_APP_CONTAINER,
      userInfo: global ? global.userInfo : {}
    }
  },
  methods: {
  },
  mounted() {
    let _this = this
    this.$eventBus.$on('changeAppLoading', loading => {
      _this.loading = loading
    })
    /*打印项目版本信息*/
    consoleVersionInfo(VERSION_INFO)
  },
  computed: {},
  created() {},
  watch: {
    $route: {
      handler(newRouter, o) {
        // 路由有requiresAuth为true标识的 允许直接访问页面 或者有菜单的
        this.showEmpty =
          (newRouter.matched.length > 0 &&
            newRouter.matched[0].meta &&
            newRouter.matched[0].meta.requiresAuth) ||
          (global.router && global.router.length > 0)
            ? false
            : true
        this.loading =
          o && newRouter.fullPath && o.fullPath ? false : global.appLoading
      },
      immediate: true
    }
  }
}
</script>
<style  lang="scss">
@import './assets/css/custom.scss';
</style>

<style scoped lang="scss">
// /deep/.el-form-item--small.el-form-item {
//   margin-bottom: 0px !important;
// }
.qiankun-child {
  font-size: 12px;
  background: white;
  // border-radius: 4px;
  width: 100%;
  height: 100%;
  .org-con {
    position: fixed;
    right: 150px;
    top: 28px;
    /deep/.form__box {
      justify-content: center;
      align-items: center;
      margin-bottom: 0;
      .form__title {
        padding: 0;
      }
      .select__box {
        border: none;
        .clear-text {
          display: none;
        }
        .select-choice__ul li.item {
          padding: 0;
          margin: 0;
          height: 23px;
          line-height: 23px;
        }
      }
    }
  }
  ._con {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    position: relative;
  }
}
</style>
